package com.para.esc.httpPostAuth;

import res.accountESB.JsonRes;
import res.accountESB.OutputParameters;
import res.accountESB.X_RESULT_TB;
import res.accountESB.X_RESULT_TB_ITEM;
import res.roleESB_2.JsonRoleESB2;

import com.alibaba.fastjson.JSON;

public class AccountESB {
	
	public static  String accountESB(String data,String url){
		HttpPostBascAuth httpPostBascAuth = new HttpPostBascAuth();
		String res=httpPostBascAuth.send(data, url);
		return res;
		
	}
public static void main(String[] args) {
	String url_account = "http://10.0.6.5:8080/webservices/rest/DEALSSOUSERS/DEAL_SSO_USERS/";
	String data_account3 ="{\"DEAL_SSO_USERS_Input\": {\"@xmlns\": \"http://xmlns.oracle.com/apps/cux/rest/DEALSSOUSERS/deal_sso_users/\",\"RESTHeader\": {\"@xmlns\": \"http://xmlns.oracle.com/apps/cux/rest/DEAL_SSO_USERS/header\",\"Responsibility\": \"\",\"RespApplication\": \"\",\"SecurityGroup\": \"\",\"NLSLanguage\": \"SIMPLIFIED CHINESE\",\"Org_Id\": \"0\"},\"InputParameters\": {\"P_SSO_USER_INFO_IN_TB\": {\"P_SSO_USER_INFO_IN_TB_ITEM\": [{\"PR_TYPE\":\"3\",\"L_USER_INFO\": {\"L_USER_INFO_ITEM\": [{\"PR_ACCOUNTNO\": \"dapanpan1\",\"PR_ACCOUNTNAM\": \"\",\"PR_ACCOUNTPWD\": \"1234567890\",\"PR_MOBILE\": \"\",\"PR_STATUS\": \"\",\"PR_ROLENAMES\": \"\",\"PR_ORGNAME\": \"\",\"PR_SEX\": \"\",\"PR_SHORTNAME\": \"\",\"PR_POST\": \"\",\"PR_IDCARD\": \"\",\"PR_ACCOUNTCOD\": \"\",\"PR_EMAIL\": \"\",\"PR_CONTACTSPH1\": \"\",\"PR_CONTACTSPH2\": \"\",\"PR_TELPHONE\": \"\",\"PR_DESC\": \"\",\"PR_PWDGRADE\": \"\",\"PR_STOREHOUSE\": \"\",\"PR_BIRTHDAY\": \"\",\"PR_OFFICE\": \"\",\"PR_COMPANY\": \"\",\"PR_LEAVEDATE\":\"2018-03-15\"}]}}]}}}}";

	String data_account4 ="{\"DEAL_SSO_USERS_Input\": {\"@xmlns\": \"http://xmlns.oracle.com/apps/cux/rest/DEALSSOUSERS/deal_sso_users/\",\"RESTHeader\": {\"@xmlns\": \"http://xmlns.oracle.com/apps/cux/rest/DEAL_SSO_USERS/header\",\"Responsibility\": \"\",\"RespApplication\": \"\",\"SecurityGroup\": \"\",\"NLSLanguage\": \"SIMPLIFIED CHINESE\",\"Org_Id\": \"0\"},\"InputParameters\": {\"P_SSO_USER_INFO_IN_TB\": {\"P_SSO_USER_INFO_IN_TB_ITEM\": [{\"PR_TYPE\":\"4\",\"L_USER_INFO\": {\"L_USER_INFO_ITEM\": [{\"PR_ACCOUNTNO\": \"dapanpan1\",\"PR_ACCOUNTNAM\": \"\",\"PR_ACCOUNTPWD\": \"1234567890\",\"PR_MOBILE\": \"\",\"PR_STATUS\": \"\",\"PR_ROLENAMES\": \"\",\"PR_ORGNAME\": \"\",\"PR_SEX\": \"\",\"PR_SHORTNAME\": \"\",\"PR_POST\": \"\",\"PR_IDCARD\": \"\",\"PR_ACCOUNTCOD\": \"\",\"PR_EMAIL\": \"\",\"PR_CONTACTSPH1\": \"\",\"PR_CONTACTSPH2\": \"\",\"PR_TELPHONE\": \"\",\"PR_DESC\": \"\",\"PR_PWDGRADE\": \"\",\"PR_STOREHOUSE\": \"\",\"PR_BIRTHDAY\": \"\",\"PR_OFFICE\": \"\",\"PR_COMPANY\": \"\",\"PR_LEAVEDATE\":\"2018-03-15\"}]}}]}}}}";
	String data_account12 ="{\"DEAL_SSO_USERS_Input\": {\"@xmlns\": \"http://xmlns.oracle.com/apps/cux/rest/DEALSSOUSERS/deal_sso_users/\",\"RESTHeader\": {\"@xmlns\": \"http://xmlns.oracle.com/apps/cux/rest/DEAL_SSO_USERS/header\",\"Responsibility\": \"\",\"RespApplication\": \"\",\"SecurityGroup\": \"\",\"NLSLanguage\": \"SIMPLIFIED CHINESE\",\"Org_Id\": \"0\"},\"InputParameters\": {\"P_SSO_USER_INFO_IN_TB\": {\"P_SSO_USER_INFO_IN_TB_ITEM\": [{\"PR_TYPE\":\"1\",\"L_USER_INFO\": {\"L_USER_INFO_ITEM\": [{\"PR_ACCOUNTNO\": \"dapanpan1\",\"PR_ACCOUNTNAM\": \"\",\"PR_ACCOUNTPWD\": \"1234567890\",\"PR_MOBILE\": \"\",\"PR_STATUS\": \"\",\"PR_ROLENAMES\": \"\",\"PR_ORGNAME\": \"\",\"PR_SEX\": \"\",\"PR_SHORTNAME\": \"\",\"PR_POST\": \"\",\"PR_IDCARD\": \"\",\"PR_ACCOUNTCOD\": \"\",\"PR_EMAIL\": \"\",\"PR_CONTACTSPH1\": \"\",\"PR_CONTACTSPH2\": \"\",\"PR_TELPHONE\": \"\",\"PR_DESC\": \"\",\"PR_PWDGRADE\": \"\",\"PR_STOREHOUSE\": \"\",\"PR_BIRTHDAY\": \"\",\"PR_OFFICE\": \"\",\"PR_COMPANY\": \"\",\"PR_LEAVEDATE\":\"\"}]}}]}}}}";
	String data_account5 ="{\"DEAL_SSO_USERS_Input\": {\"@xmlns\": \"http://xmlns.oracle.com/apps/cux/rest/DEALSSOUSERS/deal_sso_users/\",\"RESTHeader\": {\"@xmlns\": \"http://xmlns.oracle.com/apps/cux/rest/DEAL_SSO_USERS/header\",\"Responsibility\": \"\",\"RespApplication\": \"\",\"SecurityGroup\": \"\",\"NLSLanguage\": \"SIMPLIFIED CHINESE\",\"Org_Id\": \"0\"},\"InputParameters\": {\"P_SSO_USER_INFO_IN_TB\": {\"P_SSO_USER_INFO_IN_TB_ITEM\": [{\"PR_TYPE\":\"5\",\"L_USER_INFO\": {\"L_USER_INFO_ITEM\": [{\"PR_ACCOUNTNO\": \"dapanpan1\",\"PR_ACCOUNTNAM\": \"\",\"PR_ACCOUNTPWD\": \"1234567890\",\"PR_MOBILE\": \"\",\"PR_STATUS\": \"\",\"PR_ROLENAMES\": \"\",\"PR_ORGNAME\": \"\",\"PR_SEX\": \"\",\"PR_SHORTNAME\": \"\",\"PR_POST\": \"\",\"PR_IDCARD\": \"\",\"PR_ACCOUNTCOD\": \"\",\"PR_EMAIL\": \"\",\"PR_CONTACTSPH1\": \"\",\"PR_CONTACTSPH2\": \"\",\"PR_TELPHONE\": \"\",\"PR_DESC\": \"\",\"PR_PWDGRADE\": \"\",\"PR_STOREHOUSE\": \"\",\"PR_BIRTHDAY\": \"\",\"PR_OFFICE\": \"\",\"PR_COMPANY\": \"\",\"PR_LEAVEDATE\":\"\"}]}}]}}}}";
		
	
	System.out.println(data_account12);
	String res=accountESB(data_account5,url_account);
	
	
	
	
	/*JsonRes jsonRes = JSON.parseObject(res, JsonRes.class);
    OutputParameters outputParameters=jsonRes.getOutputParameters();
    X_RESULT_TB x_RESULT_TB =outputParameters.getX_RESULT_TB();
    X_RESULT_TB_ITEM x_RESULT_TB_ITEM=x_RESULT_TB.getX_RESULT_TB_ITEM();
    String RESULT_MSG = x_RESULT_TB_ITEM.getRESULT_MSG();
    String RESULT_STATUS= x_RESULT_TB_ITEM.getRESULT_STATUS();
    System.out.println(res);
    System.out.println(RESULT_MSG);
    System.out.println(RESULT_STATUS);*/
	
	
	JsonRoleESB2 jsonRoleESB2 =JSON.parseObject(res, JsonRoleESB2.class);
	res.roleESB_2.OutputParameters outputParameters = jsonRoleESB2.getOutputParameters();
	res.roleESB_2.X_RESULT_TB x_RESULT_TB = outputParameters.getX_RESULT_TB();
	res.roleESB_2.X_RESULT_TB_ITEM x_RESULT_TB_ITEM = x_RESULT_TB.getX_RESULT_TB_ITEM();
	String result_STATUS = x_RESULT_TB_ITEM.getRESULT_STATUS();
	String result_MSG = x_RESULT_TB_ITEM.getRESULT_MSG();
	System.out.println(result_STATUS);
	System.out.println(result_MSG);
	
	
	
}

}
